<?php

class Topic
{
    private $table_gateway_;

    public function __construct(TopicGateway $table_gateway)
    {
        $this->table_gateway_ = $table_gateway;
    }
    
    public function __destruct(){}
    
    public function getTopics()
    {
        return $this->table_gateway_->getTopics();
    }
    
    public function getFirstTopic()
    {
        return $this->table_gateway_->getFirstTopic();
    }
    
    public function getTopicName($t_id)
    {
        $t_id = (int)$t_id;
        if($t_id < 1)
            return false;
        return $this->table_gateway_->getTopicName($t_id);
    }
}
?>
